﻿{include file="layout/header" title="网上选课" /}
<h4>你的选课机会只有一次，请慎重考虑，一旦选择无法改变！</h4>
<p>@Html.Raw(ViewBag.info)</p>
<form method="post" action="/Enrollment/Select" onsubmit="return validate();">
    @Html.AntiForgeryToken()
    <div class="row">
        <div class="col-md-12">
            <div class="table-responsive">
                <table class="table table-condensed table-hover table-bordered table-striped">
                    <tr>
                        <th>选择</th>
                        <th>课程名称</th>
                        <th>任教老师</th>
                        <th>报名情况</th>
                    </tr>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td><input type="radio" name="CourseID1" value="@item.CourseID" @(item.Enrollments.Count() >= item.CourseNumber ? "disabled" : "") /></td>
                            <td>@Html.ActionLink(item.CourseName, "Details", "Course", new { id = item.CourseID }, null)</td>
                            <td>@Html.DisplayFor(modelItem => item.Teacher)</td>
                            <td>
                                @item.Enrollments.Count()/@item.CourseNumber
                            </td>
                        </tr>
                    }
                </table>
            </div>
        </div>
    </div>
    <p style="text-align:center;">
        <input type="submit" value="确定" class="btn btn-primary" />&nbsp;&nbsp;<input type="reset" value="重置" class="btn btn-primary" />
    </p>
</form>
{include file="layout/footer" /}